/**
 * Copyright (C), 2018, 中电福富信息科技有限公司
 * FileName: YesNoEnum
 * Author:   linxiao
 * Date:     2018/7/30 15:35
 */
package com.example.demo.enums;

import com.ffcs.oss.common.utils.LocalMessageUtil;
import com.example.demo.web.rest.constant.ExportConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author weih
 * @target
 * @date 2019/12/21 15:35
 */
@ApiModel("各导出功能定义枚举类")
public enum ExportListEnum {
    ROLE(LocalMessageUtil.getMessage(ExportConstant.EXPORT_ROLE_MANAGE), 0,
            new String[]{"角色","描述信息","创建时间","上级角色"},
            new String[]{"roleName","description","createTime","parentRoleName"}),
    ROLE_PERMISSION(LocalMessageUtil.getMessage(ExportConstant.EXPORT_ROLE_PERMISSION), 3,
            new String[]{"角色名称","菜单名称","全量菜单"},
            new String[]{"roleName","permission","fullPermission"}),
    USER(LocalMessageUtil.getMessage(ExportConstant.EXPORT_USER_MANAGE), 1,
            new String[]{"用户名","姓名","人员类型","用户归属","角色","使用状态","创建时间"},
            new String[]{"loginName","alias","userTypeCn","regionType","roleName","statusCn","createTime"}),
    NOTICE(LocalMessageUtil.getMessage(ExportConstant.EXPORT_NOTICE_MANAGE), 2,
            new String[]{"标题","类型","版本号","版本说明","发布时间","发布人","状态"},
            new String[]{"title","type","versionNo","versionRemark","publishTime","publishUser","state"}),
    EXPORT_OPERATE_LOG_BY_AREA(LocalMessageUtil.getMessage(ExportConstant.EXPORT_OPERATE_LOG_BY_AREA), 4,
            new String[]{"区域","使用次数","登录次数","有效用户数"},
            new String[]{"regionName","operateCount","loginCount","validUserCount"}),
    EXPORT_OPERATE_LOG_BY_COMPANY(LocalMessageUtil.getMessage(ExportConstant.EXPORT_OPERATE_LOG_BY_COMPANY), 5,
            new String[]{"单位","使用次数","登录次数","有效用户数"},
            new String[]{"valueCn","operateCount","loginCount","validUserCount"}),
    EXPORT_OPERATE_LOG_BY_USER(LocalMessageUtil.getMessage(ExportConstant.EXPORT_OPERATE_LOG_BY_USER), 6,
            new String[]{"用户名","姓名","区域","使用次数","登录次数"},
            new String[]{"loginName","alias","regionName","operateCount","loginCount"}),
    EXPORT_OPERATE_LOG_BY_FUN(LocalMessageUtil.getMessage(ExportConstant.EXPORT_OPERATE_LOG_BY_FUN), 7,
            new String[]{"功能名称","使用次数"},
            new String[]{"nameCn","operateCount"}),
    EXPORT_OPERATE_LOG_BY_BUSY(LocalMessageUtil.getMessage(ExportConstant.EXPORT_OPERATE_LOG_BY_BUSY), 8,
            new String[]{"时间","使用次数","登录次数","有效用户数"},
            new String[]{"fullTime","operateCount","loginCount","validUserCount"}),
    EXPORT_OPERATE_LOG_LIST(LocalMessageUtil.getMessage(ExportConstant.EXPORT_OPERATE_LOG_LIST), 9,
            new String[]{"姓名","用户名","区域","单位","时间","功能","操作"},
            new String[]{"alias","loginName","regionName","companyDesc","createTime","nameCn","operateActionDesc"}),
    EXPORT_LOGIN_LOG_LIST(LocalMessageUtil.getMessage(ExportConstant.EXPORT_LOGIN_LOG_LIST), 10,
            new String[]{"姓名","用户名","操作类型","操作状态","登录ip","登陆时间"},
            new String[]{"alias","loginName","operateAction","loginDesc","loginIp","createTime"}),
    ;


    @ApiModelProperty(name = "导出文件名")
    private String remark;
    @ApiModelProperty(name = "对应导出模块类型，自定义，不能重复")
    private Integer value;
    @ApiModelProperty(name = "字段中文名", notes = "同导出列名相同")
    private String[] expColCn;
    @ApiModelProperty(name = "字段英文名", notes = "同导出实体中对应的属性相同")
    private String[] expColEn;

    ExportListEnum(String remark, Integer value, String[]  expColCn, String[] expColEn) {
        this.remark = remark;
        this.value = value;
        this.expColCn = expColCn;
        this.expColEn = expColEn;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String[] getExpColCn() {
        return expColCn;
    }

    public void setExpColCn(String[] expColCn) {
        this.expColCn = expColCn;
    }

    public String[] getExpColEn() {
        return expColEn;
    }

    public void setExpColEn(String[] expColEn) {
        this.expColEn = expColEn;
    }

    public static ExportListEnum valueOf(Integer value) {
        for (ExportListEnum u : ExportListEnum.values()) {
            if (u.getValue().equals(value)) {
                return u;
            }
        }
        return null;
    }

}
